INCLUDE_DIRECTORIES(
	${CMAKE_CURRENT_SOURCE_DIR}/../include
	${CMAKE_CURRENT_BINARY_DIR}/../include
	${LIBXML2_INCLUDE_DIR}
)
ADD_EXECUTABLE(mbtest mbtest.cc)
ADD_EXECUTABLE(ctest ctest.c)
TARGET_LINK_LIBRARIES(mbtest musicbrainz5cc)
TARGET_LINK_LIBRARIES(ctest musicbrainz5)

IF(CMAKE_COMPILER_IS_GNUCXX)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic-errors")
		IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
			SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
		ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

IF(CMAKE_COMPILER_IS_GNUCC)
		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic-errors")
		IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
			SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
		ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
		set_source_files_properties(ctest.c PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
		set_source_files_properties(mbtest.cc PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
ENDIF(CMAKE_COMPILER_IS_GNUCC)

